Splitting of Processing Logics Associated with Commands of Pages in a Distributed Application

ABSTRACT

A mechanism is provided for controlling a distributed application. An indication of a computational capability of a client computing machine and of a server computing machine is detected. At least part of a page is built in response to a request received by the server computing machine from the client computing machine. The at least part of the page comprising a set of commands each one for submitting a next request on the client computing machine. Processing logic for serving each next request being split between a client processing component and a server processing component. The page with the client processing component for each command is returned to the client computing machine for causing the client computing machine to load the page and execute each client processing component in response to the corresponding next request. Each server processing component is executed in response to the corresponding next request.

BACKGROUND

The solution according to one or more embodiments of the presentinvention relates to the data processing field. More specifically, thissolution relates to distributed software applications.

Distributed software applications (or simply distributed applications),wherein a server computing machine (or simply server) offers a servicethat may be exploited by a large number of users accessing the serverwith their client computing machines (or simply clients), arecommonplace in modern data-processing systems, especially in theInternet. A typical example is a web application, which exposes a webinterface based on web pages that are downloaded within a web browser ofthe clients. The interaction with the web application involves thesubmission of requests to the server by selecting corresponding commandsof a current web page; the server processes each request, and returns acorresponding response (typically involving the downloading of a new webpage, or a part thereof). The web applications have become very popularin the recent years, especially thanks to the ubiquity of the webbrowsers (only required to access them) and to their simplifiedmanagement (typically not requiring any action on the clients).

In modern web applications, each web page may comprise client processingcomponents (for example, based on the JavaScript technology), each oneassociated with a command of the web page for its execution on theclient in response to the selection of the command—for example, asdescribed in “Partitioning Web Applications Between The Server And TheClient, Janne Kuuskeri, Tommi Mikkonen, SAC '09 Proceedings of the 2009ACM symposium on Applied Computing”, in U.S. Pat. No. 8,112,473 and inU.S. Pat. No. 8,190,703 (the entire disclosures of which are hereinincorporated by reference). As a result, part of a processing logicrequired to serve each request is moved to the clients, wherein its maybe executed without requiring any interaction with the server. Thisimproves the performance of the server, and reduces the network traffic(between the clients and the server).

However, the more and more processing logic that is moved to the clientsmay cause an overload thereof with a detrimental effect on theirperformance. This is particularly acute in clients with limitedcomputational capability (for example, entry level smart-phones).

This problem is not solved by the fact that very often the webapplications have ad-hoc web interfaces that are customized for specificclients (such as of the mobile type); these web interfaces may also begenerated dynamically on the clients by a browser server updatinggeneral-purpose web interfaces according to web interface data receivedfrom the server, as described in US-A-2012/0137311 (the entiredisclosure of which is herein incorporated by reference). Theabove-mentioned web interfaces are optimized for the common features ofthe corresponding clients (for example, touch screens of small size),and generally provide a reduced set of functionalities. However, in thiscase as well the same client processing components associated with eachweb page are to be executed on all the clients that download it (withthe same drawbacks pointed out above).

On the other hand, each server may become overloaded (for example, whentoo many clients access it). In this case, the performance of the serverdegrades with a detrimental effect on the level of quality of theprovided services. In order to tackle this problem, load-balancingtechniques are commonly used. In this case, the same web application isreplicated onto a plurality of servers, which are grouped into a clusterexposing a single access point to the clients. The different requestsfrom the clients are then distributed across the servers of the cluster(in a way completely transparent to the clients); for example, therequests may be distributed to the servers with a round-robin policy,according to their current workload, or with more complex policies—forexample, as described in U.S. Pat. No. 6,578,068 (the entire disclosureof which is herein incorporated by reference). In this way, it ispossible to optimize the usage of the servers of the cluster.Alternatively, as described in US-A-20100268764 (the entire disclosureof which is herein incorporated by reference), a client-side JavaScriptlogic may be used to change an address pointing to the server (so as touse the one that is best suited to serve the requests of the client).

However, in this case as well the cluster may become overloaded (withthe same drawbacks pointed out above).

In both cases, the servers are generally to be over-dimensioned so as toensure the required performance under peak conditions of their workload.However, this involves a waste of computational resources in normalsituations.

Techniques for balancing the workload among the server and the clientshave also been proposed in completely different architectures.

For example, U.S. Pat. No. 8,250,182 (the entire disclosure of which isherein incorporated by reference) relates to a server that hosts virtualmachines for the clients; in this case, the server negotiates (with eachclient) the operations that are executed on the server and on the clientaccording to capacity information of the client (possible taking intoaccount the current workload of the server as well), with this operationthat may be performed either statically (when the client requests toconnect to the server) or dynamically (in response to a re-balancingrequest). However, this architecture requires that the client should bespecifically configured for accessing the virtual machines of theserver.

Moreover, US-A-20030014478 (the entire disclosure of which is hereinincorporated by reference) relates to a distributed web browser whereinits functions (for accessing a web server) are split between a webbrowser client (running on a client) and a web browser server (runningon a proxy server); the location at which parsing, layout and renderingprocesses of the web pages are performed is changed (either staticallyor dynamically) according to the workload of one or both of the clientand the proxy server. However, this technique is not applicable tostandard web applications.

In both cases, the above-described techniques are quite intrusive, sincethey require acting heavily on the clients to change their operation.

SUMMARY

The solution according to one or more embodiments of the presentinvention is based in the idea of splitting the processing logicassociated with each command of pages of the distributed application.

Particularly, one or more aspects of the solution according to specificembodiments of the invention are set out in the independent claims andadvantageous features of the same solution are set out in the dependentclaims, with the wording of all the claims that is herein incorporatedverbatim by reference (with any advantageous feature provided withreference to a specific aspect of the solution according to anembodiment of the invention that applies mutatis mutandis to every otheraspect thereof).

More specifically, an aspect of the solution according to an embodimentof the invention provides a method for controlling a distributedapplication, wherein a processing logic for serving each next requestthat may be submitted with corresponding commands of a page (or a partthereof) is split between a client processing component and/or a serverprocessing component according to an indication of a computationalcapability of the client computing machine and/or of the servercomputing machine.

A further aspect of the solution according to an embodiment of theinvention provides a corresponding computer program.

A further aspect of the solution according to an embodiment of theinvention provides a corresponding computer program product.

A further aspect of the solution according to an embodiment of theinvention provides a corresponding system.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

The solution according to one or more embodiments of the invention, aswell as further features and the advantages thereof, will be bestunderstood with reference to the following detailed description, givenpurely by way of a non-restrictive indication, to be read in conjunctionwith the accompanying drawings (wherein, for the sake of simplicity,corresponding elements are denoted with equal or similar references andtheir explanation is not repeated, and the name of each entity isgenerally used to denote both its type and its attributes—such as value,content and representation). Particularly:

FIG. 1 shows a pictorial representation of a data-processinginfrastructure that may be used to practice the solution according to anembodiment of the invention,

FIG. 2A-FIG. 2E show an exemplary scenario of application of thesolution according to an embodiment of the invention,

FIG. 3 shows the main software modules that may be used to implement thesolution according to an embodiment of the invention, and

FIG. 4A-FIG. 4B show an activity diagram describing the flow ofactivities relating to an implementation of the solution according to anembodiment of the invention.

DETAILED DESCRIPTION

With reference in particular to the FIG. 1, a pictorial representationis shown of a data-processing infrastructure 100 that may be used topractice the solution according to an embodiment of the invention.

The data-processing infrastructure 100 has a distributed architecture,typically based on the Internet; the Internet is formed by millions ofservers 105, which are connected one to another through a globalcommunication network 110. A subset of the servers 105, known as WorldWide Web (or simply web), allows accessing corresponding web sites; eachweb site comprises a collection of web pages (connected one to anotherthrough corresponding hyper-links, starting from a home page). Each webpage is defined by a hypertext document (formatted in the HTMLlanguage), which document is accessed through the HTTP protocol; forthis purpose, the web page is identified and localized by means of acorresponding URL, which consists of a unique string formatted accordingto a standard syntax. Users of clients 115 access the Internet (throughcomputers that operate as access providers, not shown in the figure), inorder to exploit the services offered by the servers 105 (and inparticular to download desired web pages). A large variety of clients115 may be used to access the Internet; for example, the clients 115 maybe desktops, notebooks, net-books, tablets, smart-phones, and so on.

A generic server or client computing machine (or simply computer)105,115 of the data-processing infrastructure 100 is formed by severalunits that are connected in parallel to a bus structure 120 (with astructure that is suitably scaled according to the type of the computer105,115). In detail, a set of (one or more) microprocessors (μP) 125controls operation of the computer 105,115; a RAM 130 is directly usedas a working memory by the microprocessors 125, and a ROM 135 storesbasic code for a bootstrap of the computer 105,115. A mass memorycomprises internal storage units 140 (for example, a hard-disk or aflash memory) and drives 145 for external storage units 150 (forexample, optical disks or memory cards). Moreover, the computer 100comprises input/output units 155 (for example, a monitor, a keyboard, amouse or a touch-screen), and a network adapter 160 for connecting thecomputer 105,115 to the network 110.

An exemplary scenario of application of the solution according to anembodiment of the invention is shown in the FIG. 2A-FIG. 2E.

Starting from the FIG. 2A, different clients (for example, a top-levelnotebook and an entry-level smart-phone, differentiated with thereferences 115 n and 115 s, respectively), may access a web applicationhosted on a generic server 105. In the solution according to anembodiment of the invention, an indication of a computational capabilityof each client 115 n, 115 s and/or of the server 105 is detected (forexample, by collecting information about computational resources of eachclient 115 n, 115 s when it accesses the web application).

Moving to the FIG. 2B, the user of each client 115 n, 115 s submits arequest to the server 105 for downloading a selected web page 205 of theweb application (for example, its home page at the beginning). The webpage 205 comprises one or more commands that may be used on the clients115 n, 115 s for submitting corresponding next requests; each command isassociated with a processing logic 210 for serving the correspondingnext request. For example, a command of the web page 205 may be used tosubmit a request for adding an input string to a database; thecorresponding processing logic 210 performs a regular expressionvalidation of the input string, and displays an error message if theinput string is not correct or adds it to the database otherwise.

As shown in the FIG. 2C, for each client 115 n, 115 s the processinglogic 210 is split between a client processing component and/or a serverprocessing component according to the corresponding computationalcapability. For example, in the case of the more powerful notebook 115n, the processing logic 210 is split between a heavy client processingcomponent 210Cn and a light server processing component 210Sn;conversely, in the case of the less powerful smart-phone 115 s, theprocessing logic 210 is split between a light client processingcomponent 210Cs and a heavy server processing component 210Ss.

With reference now to the FIG. 2D, the web page 205 with the clientprocessing components 210Cn is returned to the client 115 n, and thesame web page 205 but with the client processing components 210Cs isreturned to the client 115 s (whereas all the server processingcomponents 210Sn,210Ss remain on the server 105).

Moving to the FIG. 2E, the user of each client 115 n, 115 s selects thesame command for submitting the same request (for example, by clickingon a corresponding button of the web page 205). This causes theexecution of the corresponding client processing components 210Cn and210Cs on the clients 115 n and 115 s, respectively; the clientprocessing components 210Cn and 210Cs process the request locally, andthen send the (processed) request to the server 105. This causes theexecution of the server processing components 210Sn and 210Ss,respectively, on the server 105; the server processing components 210Snand 210Ss further process the request remotely (with the same operationsthat may be reiterated one or more times).

For example, in the above-mentioned case, on the notebook 115 n theclient processing component 210Cn validates the input string anddisplays the error message if the input string is not correct or sendsit to the server 105 otherwise, whereas the server processing component210Sn simply adds the (already validated) input string to the database;conversely, on the smart-phone 115 s the client processing component210Cs simply sends the input string to the server 105, whereas theserver processing component 210Ss validates the input string and addsthe input string to the database if it is correct or returns the errormessage to the smart-phone 115 s wherein the client processing component210Cs displays it otherwise.

In this way, the processing logics are split between the client and theserver according to the computational capability of the client, of theserver or of both of them. For example, the client processing componentsmay self-adapt to the computational capability of the client; inaddition or in alternative, the server processing components mayself-adapt to the computational capability of the server. In both cases,this has a beneficial effect on the performance of the client and/or theserver.

The above-described solution allows distributing the workload atcomponent level between the client and the server, so that the code (andthe data) always travels between the client and the server (unlike thestandard load-balancing techniques that act at the processing levelamong different servers, so that only data travels among them).

In any case, this solution does not require any substantial change tothe operation of the clients; therefore, the solution is of generalapplicability.

The main software modules that may be used to implement the solutionaccording to an embodiment of the invention are shown in the FIG. 3.

These software modules are denoted as a whole with the reference 300.The information (programs and data) is typically stored in the massmemory and loaded (at least partially) into the working memory of each(client and server) computer when the programs are running, togetherwith an operating system and other application programs (not shown inthe figure). The programs are initially installed onto the mass memory,for example, from external storage units.

A generic server 105 runs a web server 305, which processes everyrequest submitted to the server 105 by the clients 115 (only one shownin the figure) accessing the web site(s) hosted thereon. For thispurpose, the web server 305 dispatches each request to a web application310 implementing the corresponding web site. The web application 310serves each request by executing a corresponding server processingcomponent 315; for example, the server processing component 315 may be aservlet (i.e., a persistent small program written in the Java language).The server processing component 315 may generate a web page 320 (or aportion thereof) dynamically from a corresponding template (not shown inthe figure), which web page 320 is then returned to the client throughthe web server 305. The web page 320 comprises the definition of itsrendering and of one or more client processing components 325 each oneassociated with a command of the web page 320 (for example, a button)that may be used to submit a corresponding next request; for example,the client processing component 325 may be a JavaScript (i.e., a scriptembedded in the HTML definition of the web page 320) or an applet (i.e.,an external script identified in the HTML definition of the web page320).

In the solution according to an embodiment of the invention, the webapplication 310 interacts with a splitter 330 that is used to split theprocessing logic for serving each next request into the correspondingserver processing component 315 and client processing component 325. Forthis purpose, in a proposed implementation the splitter 330 accesses arepository 335 storing heuristic rules. In another proposedimplementation, the splitter 330 interacts with a classifier 340 that isused to classify each client 115 according to its computationalcapability; for this purpose, the classifier 340 accesses a repository345 storing classification rules. In any case, the splitter 330 may alsoexploit a monitor 350, which is used to monitor a usage of computationalresources of the server 105.

Moving to the client 115, a web browser 355 is used to surf through theInternet by the user of the client 115. Particularly, for each desiredweb page 320 (identified by its URL) the web browser 355 submits acorresponding request to the respective server 105. Once the web page320 has been received by the web browser 355, it is loaded byinterpreting its HTML definition. This results in the rendering of theweb page 320 into a window (or a frame) of the web browser 355. The usermay then interact locally with the web page 320 in different ways (forexample, by entering data with the keyboard and selecting commands withthe mouse, by performing the same operations with the touch-screen, andthe like). The selection of each command of the web page 320 causes theexecution of the corresponding client processing component 325, with thepossible submission of a corresponding request to the server 105.

In this way, the above-described solution may be applied to standard webapplications in a way that is completely opaque to the clients (whichmay exploit it by using standard web browsers).

An activity diagram describing the flow of activities relating to animplementation of the solution according to an embodiment of theinvention is shown in the FIG. 4A-FIG. 4B. In this respect, each blockin the diagram may represent a module, segment or portion of code, whichcomprises one or more executable instructions for implementing thespecified logical function (or more).

Particularly, an exemplary process that may be used to control adistributed software application is represented with a method 400. Themethod 400 begins at the black start circle 402 in the swim-lane of ageneric client, and then passes to block 404 as soon as the user of theclient desires to access the distributed software application. For thispurpose, the user enters the URL of the web page defining its entrypoint (for example, the home page) into an address bar of the webbrowser. This causes the submission of a corresponding request to theserver hosting the web site (as indicated by its domain name comprisedin the URL).

In response thereto, the server (being listening for any request thatmay be submitted thereto) at block 406 serves the request by creating acorresponding new session identified by a unique session identifier (forexample, assigned dynamically to the client or defined by logininformation of its user). A specific client processing componentdesigned to detect the computational capability of the client(hereinafter referred to as detection component) is then returnedthereto at block 408 (together with the URL of the required web page andthe session identifier); for example, the detection component is anapplet signed by a trusted source (for example, an owner of the website, as certified by a trusted authority).

Returning to the swim-lane of the client, the web browser receives thedetection component at block 410. This causes its automatic launching(assuming that it has been authorized, either automatically or uponrequest). The detection component collects information about thecomputational resources of the client (for example, processing power,working memory space and speed, mass memory speed, graphical adaptercharacteristics, operating system type, browser type, and the like) byinvoking standard APIs of its operating system. Continuing to block 412,a request for executing a pre-defined server processing componentindicated in the detection component is submitted to the server, bypassing the URL of the same web page, the session identifier of theclient and the information about its computational resources.

In response thereto, the server (again being listening for any requestthat may be submitted thereto) at block 414 serves the request bylaunching the server processing component indicated therein. In thiscase, the flow of activity branches again according to an algorithm thatis used to split the processing logic (as described below).Particularly, in the case of a heuristic algorithm, the informationabout the computational resources of the client is saved at block 416into the corresponding session (as indicated by its identifier).Conversely, in the case of a classification algorithm, the client isclassified at block 418. For example, a set of disjoint classes ispre-defined for different power levels of the clients (such as 2-5classes from a lowest power level to a highest power level). Thecorresponding classification rules define a decision tree with a set ofdecision nodes each one specifying a test on a metric of thecomputational resources of the clients (i.e., its processing power,working memory space and speed, mass memory speed, graphical adaptercharacteristics, operating system and browser type in the example atissue); the branches descending from each node correspond to thepossible values of the tested attribute. Each leaf node specifies theclass of the client. The class assigned to the client is then saved asabove into the corresponding session.

In both cases, the flow of activity continues to block 420 from eitherthe block 416 or the block 418. In this phase, the flow of activitybranches again according to an approach that is used to split theprocessing logic (as described below). Particularly, in a continualapproach the flow of activity passes to block 422, wherein a usage ofcomputational resources of the server (for example, percentage ofprocessing power used, percentage of working memory used, number ofworking sessions opened, and the like) is measured by means of astandard performance-monitoring tool. The flow of activity thencontinues to block 424; the same point is also reached directly from theblock 420 in a one-shot approach.

At this point, the new web page that has to be returned to the client(as indicated in its URL) is generated dynamically from thecorresponding template. A loop is then performed for associating thecorresponding client processing component with each command that isdefined in the web page (which command may be used later on to submit acorresponding next request to the server by the user of the client). Theloop begins at block 426, wherein a penalty indicator is determined forthe processing logic of the (current) command. The penalty indicatorrepresents a loss of efficiency that might be caused by moving theprocessing logic from the client to the server. Particularly, thepenalty indicator may be based on the amount of local data to betransmitted from the client to the server for this purpose (for example,proportional to its number of bytes).

The flow of activity then branches at block 428 according to theapproach that is used to split the processing logic. Particularly, inthe one-shot approach the flow of activity further branches at block 430according to the algorithm that is used to split the processing logic.In the case of the heuristic algorithm, at block 432 the serverprocessing component and the client processing component required toserve the next request are created dynamically by applying the heuristicrules according to the computational resources of the client and thepenalty indicator. This implementation is very flexible. Conversely, inthe case of the classification algorithm, at block 434 the serverprocessing component and the client processing component required toserve the same next request are selected from pre-defined templatesaccording to the class of the client and the penalty indicator. Thisimplementation is very simple and it has a negligible impact on theperformance of the server.

In both cases, the processing logic moves from the server to the clientas its processing resources increase, and vice-versa. However, themoving of the processing logic from the client to the server isdiscouraged as its penalty indicator increases; for example, theprocessing logic may be maintained on the client (irrespectively of itsprocessing resources) when the amount of local data to be transferredfrom the client to the server reaches a threshold value. In this way, itis possible to limit the amount of data that is transferred over thenetwork. For example, in a very simple implementation the clientprocessing component alternatively comprises the processing logic foractually processing the next request or a stub code for substituting it.In the first case, the client processing component will process the nextrequest locally. In the second case, instead, the client processingcomponent will serialize any input value required to process the nextrequest (for example, as name/value pairs in the JSON format), willsubmit a request to the server for the corresponding server processingcomponent by passing these input values (wherein the next request isprocessed remotely), and then will receive a result of this processingfrom the server.

Referring back to the block 428, in the continual approach the flow ofactivity instead passes to block 436, wherein the processing logicrequired to serve the next request is mirrored into the clientprocessing component and the server processing component (so as to makeit entirely available on both the client and the server). The clientprocessing component and the server processing component are configuredat block 438 in order to actually split the processing logic betweenthem according to the computational resources of the client, the usageof the computational resources of the server and the penalty indicator.For example, the configurations of the server processing component andof the client processing component are selected from pre-definedpatterns according to the class of the client when the server implementsthe classification algorithm, whereas they are determined by applyingthe heuristic rules when the server implements the heuristic algorithm.

In both cases, the processing logic (in addition to move from the serverto the client as its processing resources increase, and vice-versa, withthe moving of the processing logic from the client to the server that isdiscouraged as its penalty indicator increases) also moves from theserver to the client when the usage of the computational resources ofthe server increase; for example, the processing logic may be moved tothe client (irrespectively of the computational capability thereof) whenthe usage of the computational resources of the server reaches athreshold value. In this way, it is possible to relieve the server whenit is overloaded. For example, in a very simple implementation theclient processing component comprises two modules, one with theprocessing logic for actually processing the next request and anotherone with a stub code for substituting it as above; the command isassociated alternatively with one of these modules according to theresult of the above-described operation.

In any case, the flow of activity merges again at block 440 from theblock 432, the block 434 or the block 438. A test is now made to verifywhether all the commands defined in the new web page have beenprocessed. If not, the flow of activity returns to the block 426 torepeat the same operations described above on a next command of the newweb page.

Conversely, the loop is exit by descending from the block 440 into block442, wherein the new web page so obtained (with the client processingcomponents of its command) is returned to the client, together with itssession identifier. The new web page is loaded at block 444 in theswim-lane of the client so as to cause its rendering thereon. As soon asthe user of the client selects a command of this (new) web page, theflow of activity passes from block 446 to block 448. In responsethereto, the client processing component associated with the selectedcommand is launched, so as to cause the local processing of thecorresponding request (for example, the actual execution of itsprocessing logic or simply the serialization of its input values in theabove-mentioned case). Assuming that the processing of the requestrequires an interaction with the server, a request for the correspondingserver processing component (indicated in the client processingcomponent) is submitted at block 450 to the server (by passing theresult of the local processing or the input values, respectively, in thesame case as above), together with the session identifier. The flow ofactivity then branches at block 452 according to the time relationshipbetween the executions of the client processing component and of theserver processing component. Particularly, if the executions of theclient processing component and of the server processing component areasynchronous (or no server processing component has been invoked) theflow of activity further branches at block 454 according to the progressof the execution of the client processing component. If the execution ofthe client processing component has not been completed yet, the flow ofactivity returns to the block 450 to continue it; conversely, the flowof activity returns to the block 446 waiting for the selection of a nextcommand of the web page. Referring back to the block 452, if theexecution of the client processing component is instead to besynchronized with the execution of the server processing component, awaiting condition is entered at block 456 for the completion of theexecution of the server processing component.

Concurrently, the server (again listening for any request that may besubmitted thereto as above) at block 458 serves the request submitted bythe client (at the block 450) by launching the server processingcomponent indicated therein. In this case, the server processingcomponent processes the request remotely (for example, by simplycompleting the processing of the result or entirely processing the inputvalues received from the client processing component in theabove-mentioned case). The flow of activity then branches at block 460as above according to the time relationship between the executions ofthe client processing component and of the server processing component.Particularly, if the execution of the client processing component is tobe synchronized with the execution of the server processing component, acompletion of the execution of the server processing component issignaled to the client at block 462 (by returning any possible resultthereof). In response thereto, the flow of activity passes from theblock 456 to the block 454 in the swim-lane of the client so as toresume the execution of the client processing component as above.Returning to the swim-lane of the server, the flow of activity continuesfrom the block 462 to block 464; the same point is also reached from theblock 460 directly when the executions of the client processingcomponent and of the server processing component are asynchronous. If atleast a portion of a new web page is to be returned to the client, theflow of activity returns to the block 424 to repeat the same operationsdescribed above; conversely, the flow of activity returns to the block458 waiting for a next request of the client.

In a completely independent way, in the continual approach the flow ofactivity further passes in the swim-lane of the server from block 466 toblock 468 as soon as predefined time-out expires (for example, every5-30 sec.). In response thereto, the usage of the computationalresources of the server is measured again. Likewise, the flow ofactivity passes in the swim-lane of the client from block 470 to block472 as soon another predefined time-out expires (for example, every 5-30sec.). In response thereto, a usage of computational resources of theclient (for example, percentage of processing power used, percentage ofworking memory used, and the like) is measured by the same detectioncomponent invoking standard APIs of the operating system of the client;information about the usage of the computational resources of the clientis then uploaded onto the server (together with the session identifier).In both cases, the configurations of the client processing component andof the server processing component for each command of the web page thatis currently displayed on the client is re-determined at block 474 asabove. A test is then made at block 476 to verify whether one or more ofthe configurations has to be changed. If so, the configuration of eachone of these server processing components is changed accordingly atblock 478. A command for forcing the required change of theconfiguration of each corresponding client processing component is sentto the client at block 480 (for example, based on the Ajax technology),together with the session identifier. In response thereto, theconfiguration of these client processing components is changedaccordingly at block 482 in the swim-lane of the client. Particularly,in the example at issue this only requires the change of the modules ofthe client processing components associated with the correspondingcommands. In this way, the splitting of the processing logic between theclient and the server may be changed dynamically according to theiractual conditions. For example, the processing logic may be moved to theserver when the usage of the computational resources of the clientreaches a threshold value, and vice-versa. As a result, it is possibleto maintain the performance of the client acceptable in any conditions.Moreover, the processing logic may be moved to the client when the usageof the computational resources of the server reaches another thresholdvalue, and vice-versa. As a result, it is possible to self-adapt theperformance of the server to its actual workload; particularly, thisallows providing a high scalability for free, since the same server maybe accessed by a growing number of clients with substantially noreduction of performance, by simply delegating some processing logic tothe clients when their number is too high.

Naturally, in order to satisfy local and specific requirements, a personskilled in the art may apply to the solution described above manylogical and/or physical modifications and alterations. Morespecifically, although this solution has been described with a certaindegree of particularity with reference to one or more embodimentsthereof, it should be understood that various omissions, substitutionsand changes in the form and details as well as other embodiments arepossible. Particularly, different embodiments of the invention may evenbe practiced without the specific details (such as the numerical values)set forth in the preceding description to provide a more thoroughunderstanding thereof; conversely, well-known features may have beenomitted or simplified in order not to obscure the description withunnecessary particulars. Moreover, it is expressly intended thatspecific elements and/or method steps described in connection with anyembodiment of the disclosed solution may be incorporated in any otherembodiment as a matter of general design choice. In any case, ordinal orother qualifiers are merely used as labels to distinguish elements withthe same name but do not by themselves connote any priority, precedenceor order. Moreover, the terms include, comprise, have, contain andinvolve (and any forms thereof) should be intended with an open,non-exhaustive meaning (i.e., not limited to the recited items), theterms based on, dependent on, according to, function of (and any formsthereof) should be intended as a non-exclusive relationship (i.e., withpossible further variable involved), and the term a/an should beintended as one or more items (unless expressly indicated otherwise).

For example, an embodiment of the present invention provides a methodfor controlling a distributed application. The method comprises thefollowing steps. An indication is detected of a computational capabilityof a client computing machine and/or of a server computing machine. Atleast part of a page is built in response to a request received by theserver computing machine from the client computing machine. The pagecomprises a set of commands each one for submitting a next request onthe client computing machine; a processing logic for serving each nextrequest is split between a client processing component and/or a serverprocessing component. The page with the client processing component foreach command is returned to the client computing machine for causing theclient computing machine to load the page and execute each clientprocessing component in response to the corresponding next request. Eachserver processing component is executed in response to the correspondingnext request.

However, the distributed application and the page may be of any type(see below); moreover, similar considerations apply when any part of thepage is built (for example, a portlet). The page may comprise any typeand number of commands (for example, hyper-links, widgets, and thelike). The processing logic for each command may be split in any way(see below), by putting it in part into the client processing componentand in part into the server processing component, or even entirely intoone of them only. Each client and server processing component maycomprise any number and type of modules (for example, based on the HTML5, Ajax, Dojo, FLEX, Flash or JavaBeans technologies).

In an embodiment of the invention, the distributed application is a webapplication; each page is a web page for loading by a web browserrunning on the client computing machine.

However, the proposed technique may be applied to any distributedapplication involving the building of any type of pages (having commandthat may be associated with client processing components)—for example,based on the WAP, HTTPS, and the like.

In an embodiment of the invention, the step of detecting an indicationof a computational capability includes detecting an indication ofcomputational resources and/or of a usage thereof.

However, the computational capability may be defined (at any moment)only by the computational resources, only by their usage or by anycombination of them. Moreover, the computational capability may bydefined by only parts of the above-mentioned metrics, or by different,additional or alternative metrics (for example, a number of cores of themicroprocessors, a network bandwidth, and the like).

In an embodiment of the invention, the step of detecting an indicationof a computational capability includes sending a detection component tothe client computing machine in response to a request of accessing thedistributed application from the client computing machine to cause theexecution of the detection component on the client computing machine;the detection component is adapted to detected the indication of thecomputational capability of the client computing machine and to returnthe indication of the computational capability of the client computingmachine to the server computing machine.

However, the detection component may be of any type (for example, a pureJavaScript module); moreover, it may be sent to the client in any otherway (for example, comprised in the first downloaded page).

In an embodiment of the invention, the step of detecting an indicationof a computational capability includes detecting the indication of thecomputational capability in response to an access of the clientcomputing machine to the distributed application.

However, the computational capability may be detected at any other time(for example, while the downloading of the first page is in progress).

In an embodiment of the invention, the method further comprises thesteps of monitoring the computational capability, and updating thesplitting of each processing logic according to the monitoredcomputational capability.

However, the computational capability may be monitored with any othertiming, even not periodically (for example, every time a new page isdownloaded) or by any other component (even distinct from the one usedto detect the computational capability when the client accesses thedistributed application). Moreover, the monitored computationalcapability may be used in any way for updating the splitting of eachprocessing logic; for example, it is possible to trace a trend of theusage of the computational resources, and update the splitting when thistrend indicates an abnormal growing of the usage of the computationalresources.

In any case, the two approaches described above may be used in whateverway. For example, it is possible to use the one-shot approach only, thecontinual approach only or any combination thereof; moreover, thecomputational capability that is detected either in the one-shot mode orin the continual mode may be defined by the computational resources, bytheir usage or by both of them (each one defined by the same ordifferent metrics).

In an embodiment of the invention, the step of building at least part ofa page includes mirroring each processing logic into the clientprocessing component and the server processing component, andconfiguring the client processing component and the server processingcomponent according to the computational capability; the step ofupdating the splitting of each processing logic includes updating theconfigurations of the client processing component and of the serverprocessing component.

However, the configurations of the client and server processingcomponents may be implemented in any way; for example, instead of havingdifferent modules that are associated alternatively with each command,it is possible to have a single module that is always associated withthe command but it is provided alternatively with differentconfiguration parameters (which are passed thereto or stored into anexternal file). In any case, in the continual approach the possibilityis not excluded of sending different client processing components to theclient computing machine every time the splitting of the correspondingprocessing logic changes. Vice-versa, in the one-shot approach thepossibility it not excluded of mirroring the processing logic into theclient and server processing components and configuring the clientprocessing component locally according to the computational capabilityof the client computing machine.

In an embodiment of the invention, the step of building at least part ofa page includes creating the client processing component and the serverprocessing component for each next request according to saidcomputational capability.

However, the client and server processing components may be created inany way (for example, according to an overall capability index based onthe metrics defining the computational capability suitably weighted).

In an embodiment of the invention, the step of detecting an indicationof a computational capability includes classifying the client computingmachine into one of a plurality of pre-defined classes according to thecomputational capability of the client computing machine; the step ofbuilding at least part of a page includes selecting the clientprocessing component and the server processing component for each nextrequest from a plurality of pre-built client processing components andserver processing components corresponding to said classes according tothe class of the client computing machine.

However, the client computing machine may be classified in any other way(for example, by means of neural networks), into any number and type ofclasses.

In any case, in both the two algorithms described above, for eachcommand it is possible to have any number of versions of the client andserver processing components; for example, it is possible to moveprocessing-intense operations, graphical-intense operations andmemory-intense operations alternatively between the client computingmachine and the server computing machine so as to obtain correspondingversions of the client and server processing components spanning alltheir possible combinations.

In an embodiment of the invention, the step of building at least part ofa page includes associating the processing logic with a penaltyindicator indicative of a loss of efficiency caused by a moving of theprocessing logic from the client computing machine to the servercomputing machine; the processing logic is split further according tothe penalty indicator.

However, the penalty indicator may be of any type (see below). Moreover,it may be used in any way to define the splitting of the processinglogic (for example, simply using it as an additional metric of thecomputational capability, or as a flag that conditions the moving of theprocessing logic to the server computing machine after reaching athreshold value). In any case, this feature may also be omitted at allin a simplified implementation.

In an embodiment of the invention, the penalty indicator is based on anamount of data to be transmitted between the client computing machineand the server computing machine during the execution of the clientprocessing component and the server processing component.

However, the penalty indicator may be based on different, additional oralternative values (for example, a type of network connection thatincreases the penalty indicator as its speed decreases, such as fromEthernet to ADSL, Wi-Fi, LTE, HSDPA, and GPRS).

In an embodiment of the invention, the method further comprises the stepof synchronizing the execution of the client processing component and ofthe server processing component for each next request.

However, this synchronization may be implemented in any way (forexample, with only one or multiple interactions between the clientcomputing machine and the service computing machine); in any case, acompletely asynchronous implementation is not excluded.

Generally, similar considerations apply if the same solution isimplemented with an equivalent method (by using similar steps with thesame functions of more steps or portions thereof, removing some stepsbeing non-essential, or adding further optional steps); moreover, thesteps may be performed in a different order, concurrently or in aninterleaved way (at least in part).

Another embodiment of the present invention provides a computer programcomprising code means for causing a computing system to perform thesteps of the above-described method when the computer program isexecuted on the computing system.

Another embodiment of the present invention provides a computer programproduct comprising a non-transitory computer readable medium embodying acomputer program, the computer program comprising code means directlyloadable into a working memory of a computing system thereby configuringthe computing system to perform the same method.

However, the above-described solution may be implemented entirely on theserver computing machine as a stand-alone module, as a plug-in for theweb server, or even directly in the web server itself; alternatively,the same solution may be implemented in each web application. In anycase, the possibility of implementing the solution partly on the servercomputing machine and partly on the client computing machines (forexample, by updating their web browsers) is not excluded.

As will be appreciated by one skilled in the art, aspects of the presentinvention may be embodied as a system, method or computer programproduct. Accordingly, aspects of the present invention may take the formof an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.) or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit.” “module” or “system.”Furthermore, aspects of the present invention may take the form of acomputer program product embodied in one or more computer readablemedium(s) having computer readable program code embodied thereon. Anycombination of one or more computer readable medium(s) may be utilized.The computer readable medium may be a computer readable signal medium ora computer readable storage medium. A computer readable storage mediummay be, for example, but not limited to, an electronic, magnetic,optical, electromagnetic, infrared, or semiconductor system, apparatus,or device, or any suitable combination of the foregoing. More specificexamples (a non-exhaustive list) of the computer readable storage mediumwould include the following: an electrical connection having one or morewires, a portable computer diskette, a hard disk, a random access memory(RAM), a read-only memory (ROM), an erasable programmable read-onlymemory (EPROM or Flash memory), an optical fiber, a portable compactdisc read-only memory (CD-ROM), an optical storage device, a magneticstorage device, or any suitable combination of the foregoing. In thecontext of this document, a computer readable storage medium may be anytangible medium that can contain, or store a program for use by or inconnection with an instruction execution system, apparatus, or device. Acomputer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbase-band or as part of a carrier wave. Such a propagated signal maytake any of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device. Program codeembodied on a computer readable medium may be transmitted using anyappropriate medium, including but not limited to wireless, wireline,optical fiber cable, RF, etc., or any suitable combination of theforegoing. Computer program code for carrying out operations for aspectsof the present invention may be written in any combination of one ormore programming languages, including an object oriented programminglanguage such as Java, Smalltalk, C++ or the like and conventionalprocedural programming languages, such as the “C” programming languageor similar programming languages. The program code may execute entirelyon the relevant computer, as a stand-alone software package, partly onthis computer and partly on a remote computer or entirely on the remotecomputer. In the latter scenario, the remote computer may be connectedto the computer through any type of network, including a local areanetwork (LAN) or a wide area network (WAN), or the connection may bemade to an external computer (for example, through the Internet using anInternet Service Provider). Aspects of the present invention have beendescribed with reference to flowchart illustrations and/or blockdiagrams of methods, apparatus (systems) and computer program productsaccording to embodiments of the invention. It will be understood thateach block of the flowchart illustrations and/or block diagrams, andcombinations of blocks in the flowchart illustrations and/or blockdiagrams, can be implemented by computer program instructions. Thesecomputer program instructions may be provided to a processor of ageneral purpose computer, special purpose computer, or otherprogrammable data processing apparatus to produce a machine, such thatthe instructions, which execute via the processor of the computer orother programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer program instructions may also bestored in a computer readable medium that can direct a computer, otherprogrammable data processing apparatus, or other devices to function ina particular manner, such that the instructions stored in the computerreadable medium produce an article of manufacture including instructionswhich implement the function/act specified in the flowchart and/or blockdiagram block or blocks. The computer program instructions may also beloaded onto a computer, other programmable data processing apparatus, orother devices to cause a series of operational steps to be performed onthe computer, other programmable apparatus or other devices to produce acomputer implemented process such that the instructions which execute onthe computer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

Another embodiment of the present invention provides a system comprisingmeans configured for performing the steps of the above-described method.

However, the same solution may also be carried out on a system based ona different architecture (for example, a local, wide area, global,cellular or satellite network), and exploiting any type of (wired and/orwireless) connections. In any case, each computer may have anotherstructure or may comprise similar elements (such as cache memoriestemporarily storing the programs or parts thereof); moreover, it ispossible to replace the computer with any computing (or code execution)entity, either based on a physical machine or a virtual machine, or witha combination of multiple entities (such as a multi-tier architecture, agrid computing infrastructure, and the like).

Generally, similar considerations apply if the system has a differentstructure or comprises equivalent components, or it has other operativecharacteristics. In any case, every component thereof may be separatedinto more elements, or two or more components may be combined togetherinto a single element; moreover, each component may be replicated tosupport the execution of the corresponding operations in parallel.Moreover, unless specified otherwise, any interaction between differentcomponents generally does not need to be continuous, and it may beeither direct or indirect through one or more intermediaries.

1. A method for controlling a distributed application, the methodcomprising: detecting an indication of a computational capability of aclient computing machine or of a server computing machine, building atleast part of a page in response to a request received by the servercomputing machine from the client computing machine, the page comprisinga set of commands each one for submitting a next request on the clientcomputing machine, a processing logic for serving each next requestbeing split between a client processing component and a serverprocessing component, returning the page with the client processingcomponent for each command to the client computing machine for causingthe client computing machine to load the page and execute each clientprocessing component in response to the corresponding next request, andexecuting each server processing component in response to thecorresponding next request.
 2. The method according to claim 1, whereinthe distributed application is a web application, and wherein each pagebeing a web page for loading by a web browser running on the clientcomputing machine.
 3. The method according to claim 1, wherein detectingthe indication of the computational capability comprises: detecting anindication of computational resources or a usage of the computationresources.
 4. The method according to claim 1, wherein detecting theindication of the computational capability comprises: sending adetection component to the client computing machine in response to arequest of accessing the distributed application from the clientcomputing machine to cause the execution of the detection component onthe client computing machine, the detection component being adapted todetect the indication of the computational capability of the clientcomputing machine and to return the indication of the computationalcapability of the client computing machine to the server computingmachine.
 5. The method according to claim 1, wherein detecting theindication of the computational capability comprises: detecting theindication of the computational capability in response to an access ofthe client computing machine to the distributed application.
 6. Themethod according to claim 1, further comprising: monitoring thecomputational capability, and updating the splitting of each processinglogic according to the monitored computational capability.
 7. The methodaccording to claim 6, wherein building the at least part of the pagecomprises: mirroring each processing logic into the client processingcomponent and the server processing component, and configuring theclient processing component and the server processing componentaccording to the computational capability, and wherein updating thesplitting of each processing logic comprises: updating configurations ofthe client processing component and of the server processing component.8. The method according to claim 1, wherein building the at least partof the page comprises: creating the client processing component and theserver processing component for each next request according to thecomputational capability of the client computing machine or the servercomputing machine, respectively.
 9. The method according to claim 1,wherein detecting the indication of the computational capabilitycomprises: classifying the client computing machine into one of aplurality of pre-defined classes according to the computationalcapability of the client computing machine, and wherein building the atleast part of the page comprises: selecting the client processingcomponent and the server processing component for each next request froma plurality of pre-built client processing components and serverprocessing components corresponding to the plurality of defined classesaccording to a class of the client computing machine.
 10. The methodaccording to claim 1, wherein building the at least part of the pagecomprises: associating the processing logic with a penalty indicatorindicative of a loss of efficiency caused by a moving of the processinglogic from the client computing machine to the server computing machine,the processing logic being split further according to the penaltyindicator.
 11. The method according to claim 10, wherein the penaltyindicator is based on an amount of data to be transmitted between theclient computing machine and the server computing machine during theexecution of the client processing component and the server processingcomponent.
 12. The method according to claim 1, further comprising:synchronizing the execution of the client processing component and ofthe server processing component for each next request.
 13. A computerprogram product comprising a computer readable medium having a computerreadable program for causing a computing system to control a distributedapplication stored therein, wherein the computer readable program, whenexecuted on the computing system, causes the computing system to: detectan indication of a computational capability of a client computingmachine or of a server computing machine, build at least part of a pagein response to a request received by the server computing machine fromthe client computing machine, the page comprising a set of commands eachone for submitting a next request on the client computing machine, aprocessing logic for serving each next request being split between aclient processing component and a server processing component, returnthe page with the client processing component for each command to theclient computing machine for causing the client computing machine toload the page and execute each client processing component in responseto the corresponding next request, and execute each server processingcomponent in response to the corresponding next request.
 14. A systemfor controlling a distributed application comprising: a processor; and amemory coupled to the processor, wherein the memory comprisesinstructions which, when executed by the processor, cause the processorto: detect an indication of a computational capability of a clientcomputing machine or of a server computing machine, build at least partof a page in response to a request received by the server computingmachine from the client computing machine, the pane comprising a set ofcommands each one for submitting a next request on the client computingmachine, a processing logic for serving each next request being splitbetween a client processing component and a server processing component,return the page with the client processing component for each command tothe client computing machine for causing the client computing machine toload the page and execute each client processing component in responseto the corresponding next request, and execute each server processingcomponent in response to the corresponding next request.
 15. The systemof claim 14, wherein the instructions to detect the indication of thecomputational capability further causes the processor to: detect anindication of computational resources or a usage of the computationresources.
 16. The system of claim 14, wherein the instructions todetect the indication of the computational capability further causes theprocessor to: send a detection component to the client computing machinein response to a request of accessing the distributed application fromthe client computing machine to cause the execution of the detectioncomponent on the client computing machine, the detection component beingadapted to detect the indication of the computational capability of theclient computing machine and to return the indication of thecomputational capability of the client computing machine to the servercomputing machine.
 17. The system of claim 14, wherein the instructionsto detect the indication of the computational capability further causesthe processor to: detect the indication of the computational capabilityin response to an access of the client computing machine to thedistributed application.
 18. The system of claim 14, wherein theinstructions further cause the processor to: monitor the computationalcapability, and update the splitting of each processing logic accordingto the monitored computational capability.
 19. The system of claim 18,wherein the instructions to build the at least part of the page furthercauses the processor to: mirror each processing logic into the clientprocessing component and the server processing component, and configurethe client processing component and the server processing componentaccording to the computational capability, and wherein the instructionsto update the splitting of each processing logic further causes theprocessor to: update configurations of the client processing componentand of the server processing component.
 20. The system of claim 14,wherein the instructions to build the at least part of the page furthercauses the processor to: create the client processing component and theserver processing component for each next request according to thecomputational capability of the client computing machine or the servercomputing machine, respectively.